import { createReadOnlyDict,getAllDictMap } from "../../utils/readOnlyDict";

const YES_OR_NO = createReadOnlyDict([
    {
        label:'是',
        value:true
    },
    {
        label:'否',
        value:false
    }
]);

const LOG_LEVEL = createReadOnlyDict([
    {
        label:'ERROR',
        value:1
    },
    {
        label:'WARN',
        value:2
    },
    {
        label:'INFO',
        value:3
    },
    {
        label:'DEBUG',
        value:4
    },
    {
        label:'VERBOSE',
        value:5
    }
]);

const PLUG_OPERATE_TYPE = createReadOnlyDict([
    {
        label:'查询',
        value:'list',
        url:'/cli/list',
    },
    {
        label:'安装',
        value:'install',
        url:'/cli/install',
    },
    {
        label:'卸载',
        value:'uninstall',
        url:'/cli/uninstall',
    }
]);

const PLUG_SHOW_TYPE = createReadOnlyDict([
    {
        label:'本地库',
        value:'local'
    },
    {
        label:'插件库',
        value:'remote'
    }
]);

const DATA_SOURCE_TYPE = createReadOnlyDict([
    {
        label:'国内',
        value:'gitee'
    },
    {
        label:'全球',
        value:'github'
    }
]);

const result={
    YES_OR_NO,
    LOG_LEVEL,
    PLUG_OPERATE_TYPE,
    PLUG_SHOW_TYPE,
    DATA_SOURCE_TYPE
}
export default {
    ...result,
    ...getAllDictMap(result)
}
